//const PasswordDao = require('../dao/password');
const ok = require('../core/response-shortcut');

const ValidatorInsertStkNotes = require('../validatorsFe/insertStkNotes');
const InsertStkNotesDao = require('../daoFe/insertStkNotes');



class insertStkNotesController {

  static async insert(ctx) {
    // 接收客户端参数
    let req = ctx.request.body;

    //验证器,如果验证不通过,直接在验证器里报错
    await ValidatorInsertStkNotes.insert(req)
    await InsertStkNotesDao.insert(ctx);
    ctx.response.status = 200;
    ctx.body = ok.success()
  }
  
  static async update(ctx) {
    // 接收客户端参数
    let req = ctx.request.body;
    //验证器,如果验证不通过,直接在验证器里报错
    await ValidatorInsertStkNotes.update(req)
    let res = await InsertStkNotesDao.update(ctx);
    ctx.response.status = 200;
    ctx.body = ok.update(res)
 
  }
}

module.exports = insertStkNotesController